@page
@{ Layout = "_LayoutHome"; }
@section Styles{
    <style>
        body,html{
            padding: 0;
            margin: 0;
        }
    </style>
}
<div class="rounded-0 shadow p-3 bg-white sticky-top">
    <div class="fw-bolder text-center">
        知识库
    </div>
</div>
<div class="p-5" v-if="total>0">
    <div class="mx-3">
        <el-form v-on:submit.native.prevent :inline="true" :model="form">
            <el-form-item label="已赞">
                <el-checkbox v-model="form.like">
                </el-checkbox>
            </el-form-item>
            <el-form-item label="已收藏">
                <el-checkbox v-model="form.collect">
                </el-checkbox>
            </el-form-item>
            <el-form-item label="">
                <el-input clearable prefix-icon="el-icon-search" v-model="form.keywords" placeholder="关键字"></el-input>
            </el-form-item>
            <el-form-item label="" class="p-0 m-0">
                <el-button icon="el-icon-search" v-on:click="btnSearchClick">查 询</el-button>
                <el-button icon="el-icon-search" v-on:click="treeSearchShow=!treeSearchShow">更多查询</el-button>
            </el-form-item>
        </el-form>
    </div>
    <el-card class="m-3" v-if="treeSearchShow">
        <div class="mb-3 fw-bold">分类查询</div>
        <div v-for="treeSearch in treeSearchList">
            <el-divider v-if="treeSearch.deep>0"></el-divider>
            <template v-for="treeSearchItem in treeSearch.list">
                <el-button class="me-1 mb-1" type="primary" size="mini" v-if="treeSearchItem.id===treeSearch.selectId" v-on:click="btnTreeNodeClick(treeSearch,treeSearchItem)">{{ treeSearchItem.name }}</el-button>
                <el-button class="me-1 mb-1" size="mini" v-else v-on:click="btnTreeNodeClick(treeSearch,treeSearchItem)">{{ treeSearchItem.name }}</el-button>
            </template>
        </div>
    </el-card>
    <div>
        <div class="row g-3">
            <div class="col-2">
                <div class="card-lift mb-3 p-3" v-on:click="btnViewClick(know)" style="cursor:pointer;" v-for="know in list1">
                    <div class="position-relative">
                        <img :src="know.coverImgUrl" class="img-fluid card-img shadow-lg rounded-3">
                    </div>
                    <div class="p-2">
                        <small><span class="me-2"><i class="bi bi-hand-thumbs-up"></i> {{ know.likes }}</span><span><i class="bi bi-star"></i> {{ know.collects }}</span></small>
                        <div class="fw-bolder">
                            {{ know.name }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-2">
                <div class="card-lift mb-3 p-3" v-on:click="btnViewClick(know)" style="cursor:pointer;" v-for="know in list2">
                    <div class="position-relative">
                        <img :src="know.coverImgUrl" class="img-fluid card-img shadow-lg rounded-3">
                    </div>
                    <div class="p-2">
                        <small><span class="me-2"><i class="bi bi-hand-thumbs-up"></i> {{ know.likes }}</span><span><i class="bi bi-star"></i> {{ know.collects }}</span></small>
                        <div class="fw-bolder">
                            {{ know.name }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-2">
                <div class="card-lift mb-3 p-3" v-on:click="btnViewClick(know)" style="cursor:pointer;" v-for="know in list3">
                    <div class="position-relative">
                        <img :src="know.coverImgUrl" class="img-fluid card-img shadow-lg rounded-3">
                    </div>
                    <div class="p-2">
                        <small><span class="me-2"><i class="bi bi-hand-thumbs-up"></i> {{ know.likes }}</span><span><i class="bi bi-star"></i> {{ know.collects }}</span></small>
                        <div class="fw-bolder">
                            {{ know.name }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-2">
                <div class="card-lift mb-3 p-3" v-on:click="btnViewClick(know)" style="cursor:pointer;" v-for="know in list4">
                    <div class="position-relative">
                        <img :src="know.coverImgUrl" class="img-fluid card-img shadow-lg rounded-3">
                    </div>
                    <div class="p-2">
                        <small><span class="me-2"><i class="bi bi-hand-thumbs-up"></i> {{ know.likes }}</span><span><i class="bi bi-star"></i> {{ know.collects }}</span></small>
                        <div class="fw-bolder">
                            {{ know.name }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-2">
                <div class="card-lift mb-3 p-3" v-on:click="btnViewClick(know)" style="cursor:pointer;" v-for="know in list5">
                    <div class="position-relative">
                        <img :src="know.coverImgUrl" class="img-fluid card-img shadow-lg rounded-3">
                    </div>
                    <div class="p-2">
                        <small><span class="me-2"><i class="bi bi-hand-thumbs-up"></i> {{ know.likes }}</span><span><i class="bi bi-star"></i> {{ know.collects }}</span></small>
                        <div class="fw-bolder">
                            {{ know.name }}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-2">
                <div class="card-lift mb-3 p-3" v-on:click="btnViewClick(know)" style="cursor:pointer;" v-for="know in list6">
                    <div class="position-relative">
                        <img :src="know.coverImgUrl" class="img-fluid card-img shadow-lg rounded-3">
                    </div>
                    <div class="p-2">
                        <small><span class="me-2"><i class="bi bi-hand-thumbs-up"></i> {{ know.likes }}</span><span><i class="bi bi-star"></i> {{ know.collects }}</span></small>
                        <div class="fw-bolder">
                            {{ know.name }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="my-5 text-center">
            <el-button class="border-0 rounded-pill" icon="el-icon-refresh-right" v-if="total>pushTotal" v-on:click="btnLoadMoreClick" :loading="loadMoreLoading">加载剩余的 {{total-pushTotal}} 条</el-button>
            <small v-else>没有更多了</small>
        </div>
    </div>
</div>
<div v-else>
    <el-empty></el-empty>
</div>
@section Scripts{
    <script src="/sitefiles/assets/js/home/knowledges/knowledges.js" type="text/javascript"></script>
}